<?php
    Yii::import('application.models.account.Customer');
    $model=new Customer();
?>
<div id="reg" class="popup1" style="display: none;">
    <a onclick="Main.closePopup($('#reg'));" href="javascript:void(0);" class="closepopup1"></a>
    <div class="popup1header1"><?php echo Yii::t('account/customer','registerFormHeader'); ?></div>
    <img id="ajaxBusy" style="display: none; position: absolute; top: 10px; left: 10px; z-index: 9999" src="<?php echo Yii::app()->request->baseUrl; ?>/images/indicator.gif">

    <div class="popup1form1">

        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'register-form',
            'action'=>Yii::app()->createUrl('account/index/register'),
            'method'=>'post',
            'enableAjaxValidation'=>true,
            'clientOptions'=>array(
                'validateOnSubmit'=>true,
                'validateOnChange'=>false,
            ),
        )); ?>

        <?php echo CHtml::errorSummary(array($model)); ?>

        <div class="formline">
            <label class="l3"><?php echo $model->getAttributeLabel('firstname'); ?>*:</label>
            <?php echo $form->textField($model,'firstname',array(
                //'placeholder'=>$model->getAttributeLabel('firstname'),
                'class'=>'input2',
            )) ?>
            <?php echo $form->error($model,'firstname'); ?>
        </div>


        <div class="formline">
            <label class="l3"><?php echo $model->getAttributeLabel('telephone'); ?>:</label>
            <?php echo $form->textField($model,'telephone',array(
                //'placeholder'=>$model->getAttributeLabel('telephone'),
                'class'=>'input2',
            )) ?>
            <?php echo $form->error($model,'telephone'); ?>
        </div>

        <div class="formline">
            <label class="l3"><?php echo $model->getAttributeLabel('email'); ?>*:</label>
            <?php echo $form->textField($model,'email',array(
                //'placeholder'=>$model->getAttributeLabel('email'),
                'class'=>'input2',
            )) ?>
            <?php echo $form->error($model,'email'); ?>
        </div>

        <div class="formline">
            <label class="l3"><?php echo $model->getAttributeLabel('password'); ?>*:</label>
            <?php echo $form->passwordField($model,'password',array(
                //'placeholder'=>$model->getAttributeLabel('password'),
                'class'=>'input2',
            )) ?>
            <?php echo $form->error($model,'password'); ?>
        </div>

        <div class="formline">
            <label class="l3"><?php echo $model->getAttributeLabel('retypePassword'); ?>*:</label>
            <?php echo $form->passwordField($model,'retypePassword',array(
                //'placeholder'=>$model->getAttributeLabel('retypePassword'),
                'class'=>'input2',
            )) ?>
            <?php echo $form->error($model,'retypePassword'); ?>
        </div>

        <?php if(CCaptcha::checkRequirements() && Yii::app()->user->isGuest): ?>
            <div style="width:260px; padding-right: 3px;" class="captchablock">
                <label style="margin-left: -182px; padding-top: 43px; position: absolute;" class="l3"><?php echo Yii::t('account/customer','registerFormCaptchaLabel'); ?>*:</label>
                <?php $this->widget('CCaptcha',array(
                    'captchaAction'=>'account/index/captcha',
                    'clickableImage'=>true,
                    'showRefreshButton'=>false,
                    'imageOptions'=>array(
                        'style'=>'cursor:pointer;',
                        'alt'=>Yii::t('account/customer','verificationCode'),
                        'title'=>Yii::t('account/customer','pressVerificationCode'),
                    ),
                )); ?>
                <?php echo $form->textField($model,'verifyCode',array(
                    'class'=>'input2',
                    'placeholder'=>$model->getAttributeLabel('verifyCode').' *',
                )) ?>
                <?php echo $form->error($model,'verifyCode'); ?>
            </div>
        <?php endif; ?>

        <div class="clear"></div>
        <div class="reqline">* <?php echo Yii::t('account/customer','requiredFields'); ?></div>

        <?php echo CHtml::link(Yii::t('base','register'),'#',array(
            'class'=>'btnsend reg',
            'onclick'=>'Main.formSubmit($("#register-form")); return false;',
        )); ?>

        <?php $this->endWidget(); ?>
    </div>
</div>